import java.awt.*;
import java.util.Random;

public class FoodCreate {
    public FoodCreate() {

    }
    public Ponit create(Snake snake){
        Random random = new Random();
        int x = random.nextInt(Setting.WIDTH_NUM);
        int y = random.nextInt(Setting.HEIGHT_NUM);
        x = x + 1;
        y = y + 1;
        for (int i = 0; i < snake.list.size(); i++){
            if (snake.list.get(i).getX() == x && snake.list.get(i).getY() == y){
                x = random.nextInt(Setting.WIDTH_NUM) + 1;
                y = random.nextInt(Setting.HEIGHT_NUM) + 1;
                i = 0;
            }
        }
        Ponit p = new Ponit(x, y);
        return p;
    }
}
